#include "simple_mesh.hpp"

NAMESPACE_BEGIN(vktdev)

// clang-format off
const SimpleMesh MESH_Triangle {
    Vector<SimpleMesh::Vertex> {
        // position,           color,              normal,             texcoord
        {{-1.0f, -1.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f}}, // 左下角
        {{ 1.0f, -1.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, // 右下角
        {{ 0.0f,  1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, 1.0f}, {0.5f, 1.0f}}, // 上中
    },
    Vector<SimpleMesh::Index> {
        0, 1, 2,
    },
};

const SimpleMesh MESH_Rectangle {
    Vector<SimpleMesh::Vertex> {
        // position,           color,              normal,             texcoord
        {{ 1.0f,  1.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 1.0f}, {1.0f, 1.0f}}, // 右上
        {{ 1.0f, -1.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, // 右下
        {{-1.0f, -1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f}}, // 左下
        {{-1.0f,  1.0f, 0.0f}, {1.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}, {0.0f, 1.0f}}, // 左上
    },
    Vector<SimpleMesh::Index> {
        0, 1, 2,
        2, 3, 0,
    },
};

const SimpleMesh MESH_Cube {
    Vector<SimpleMesh::Vertex> {
        // position,            color,              normal,               texcoord
        // Back face
        {{-1.0f, -1.0f, -1.0f}, {1.0f, 1.0f, 1.0f}, {0.0f,  0.0f, -1.0f}, {0.0f, 0.0f}}, // Bottom-left
        {{ 1.0f,  1.0f, -1.0f}, {1.0f, 1.0f, 1.0f}, {0.0f,  0.0f, -1.0f}, {1.0f, 1.0f}}, // top-right
        {{ 1.0f, -1.0f, -1.0f}, {1.0f, 1.0f, 1.0f}, {0.0f,  0.0f, -1.0f}, {1.0f, 0.0f}}, // bottom-right
        {{ 1.0f,  1.0f, -1.0f}, {1.0f, 1.0f, 1.0f}, {0.0f,  0.0f, -1.0f}, {1.0f, 1.0f}}, // top-right
        {{-1.0f, -1.0f, -1.0f}, {1.0f, 1.0f, 1.0f}, {0.0f,  0.0f, -1.0f}, {0.0f, 0.0f}}, // bottom-left
        {{-1.0f,  1.0f, -1.0f}, {1.0f, 1.0f, 1.0f}, {0.0f,  0.0f, -1.0f}, {0.0f, 1.0f}}, // top-left
        // Front face
        {{-1.0f, -1.0f,  1.0f}, {1.0f, 1.0f, 1.0}, {0.0f,  0.0f,  1.0f}, {0.0f, 0.0f}}, // bottom-left
        {{ 1.0f, -1.0f,  1.0f}, {0.0f, 0.0f, 0.0}, {0.0f,  0.0f,  1.0f}, {1.0f, 0.0f}}, // bottom-right
        {{ 1.0f,  1.0f,  1.0f}, {0.0f, 0.0f, 0.0}, {0.0f,  0.0f,  1.0f}, {1.0f, 1.0f}}, // top-right
        {{ 1.0f,  1.0f,  1.0f}, {1.0f, 0.0f, 0.0}, {0.0f,  0.0f,  1.0f}, {1.0f, 1.0f}}, // top-right
        {{-1.0f,  1.0f,  1.0f}, {0.0f, 1.0f, 0.0}, {0.0f,  0.0f,  1.0f}, {0.0f, 1.0f}}, // top-left
        {{-1.0f, -1.0f,  1.0f}, {0.0f, 0.0f, 1.0}, {0.0f,  0.0f,  1.0f}, {0.0f, 0.0f}}, // bottom-left
        // Left face
        {{-1.0f,  1.0f,  1.0f}, {1.0f, 0.0f, 0.0f}, {1.0f,  0.0f,  0.0f}, {1.0f, 0.0f}}, // top-right
        {{-1.0f,  1.0f, -1.0f}, {1.0f, 0.0f, 0.0f}, {1.0f,  0.0f,  0.0f}, {1.0f, 1.0f}}, // top-left
        {{-1.0f, -1.0f, -1.0f}, {1.0f, 0.0f, 0.0f}, {1.0f,  0.0f,  0.0f}, {0.0f, 1.0f}}, // bottom-left
        {{-1.0f, -1.0f, -1.0f}, {1.0f, 0.0f, 0.0f}, {1.0f,  0.0f,  0.0f}, {0.0f, 1.0f}}, // bottom-left
        {{-1.0f, -1.0f,  1.0f}, {1.0f, 0.0f, 0.0f}, {1.0f,  0.0f,  0.0f}, {0.0f, 0.0f}}, // bottom-right
        {{-1.0f,  1.0f,  1.0f}, {1.0f, 0.0f, 0.0f}, {1.0f,  0.0f,  0.0f}, {1.0f, 0.0f}}, // top-right
        // Right face
        {{ 1.0f,  1.0f,  1.0f}, {0.0f, 0.0f, 1.0f}, {1.0f,  0.0f,  0.0f}, {1.0f, 0.0f}}, // top-left
        {{ 1.0f, -1.0f, -1.0f}, {0.0f, 0.0f, 1.0f}, {1.0f,  0.0f,  0.0f}, {0.0f, 1.0f}}, // bottom-right
        {{ 1.0f,  1.0f, -1.0f}, {0.0f, 0.0f, 1.0f}, {1.0f,  0.0f,  0.0f}, {1.0f, 1.0f}}, // top-right
        {{ 1.0f, -1.0f, -1.0f}, {0.0f, 0.0f, 1.0f}, {1.0f,  0.0f,  0.0f}, {0.0f, 1.0f}}, // bottom-right
        {{ 1.0f,  1.0f,  1.0f}, {0.0f, 0.0f, 1.0f}, {1.0f,  0.0f,  0.0f}, {1.0f, 0.0f}}, // top-left
        {{ 1.0f, -1.0f,  1.0f}, {0.0f, 0.0f, 1.0f}, {1.0f,  0.0f,  0.0f}, {0.0f, 0.0f}}, // bottom-left
        // Bottom face
        {{-1.0f, -1.0f, -1.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, -1.0f,  0.0f}, {0.0f, 1.0f}}, // top-right
        {{ 1.0f, -1.0f, -1.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, -1.0f,  0.0f}, {1.0f, 1.0f}}, // top-left
        {{ 1.0f, -1.0f,  1.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, -1.0f,  0.0f}, {1.0f, 0.0f}}, // bottom-left
        {{ 1.0f, -1.0f,  1.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, -1.0f,  0.0f}, {1.0f, 0.0f}}, // bottom-left
        {{-1.0f, -1.0f,  1.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, -1.0f,  0.0f}, {0.0f, 0.0f}}, // bottom-right
        {{-1.0f, -1.0f, -1.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, -1.0f,  0.0f}, {0.0f, 1.0f}}, // top-right
        // Top face
        {{-1.0f,  1.0f, -1.0f}, {1.0f, 0.0f, 1.0f}, {0.0f,  1.0f,  0.0f}, {0.0f, 1.0f}}, // top-left
        {{ 1.0f,  1.0f,  1.0f}, {1.0f, 0.0f, 1.0f}, {0.0f,  1.0f,  0.0f}, {1.0f, 0.0f}}, // bottom-right
        {{ 1.0f,  1.0f, -1.0f}, {1.0f, 0.0f, 1.0f}, {0.0f,  1.0f,  0.0f}, {1.0f, 1.0f}}, // top-right
        {{ 1.0f,  1.0f,  1.0f}, {1.0f, 0.0f, 1.0f}, {0.0f,  1.0f,  0.0f}, {1.0f, 0.0f}}, // bottom-right
        {{-1.0f,  1.0f, -1.0f}, {1.0f, 0.0f, 1.0f}, {0.0f,  1.0f,  0.0f}, {0.0f, 1.0f}}, // top-left
        {{-1.0f,  1.0f,  1.0f}, {1.0f, 0.0f, 1.0f}, {0.0f,  1.0f,  0.0f}, {0.0f, 0.0f}}, // bottom-left
    },
    Vector<SimpleMesh::Index> {
         0,  1,  2,  3,  4,  5,
         6,  7,  8,  9, 10, 11,
        12, 13, 14, 15, 16, 17,
        18, 19, 20, 21, 22, 23,
        24, 25, 26, 27, 28, 29,
        30, 31, 32, 33, 34, 35,
    },
};

const SimpleMesh MESH_Frustum {
    Vector<SimpleMesh::Vertex> {
        // position,            color,              normal,               texcoord
        // Back face
        {{-1.0f, -1.0f, -1.0f}, {1.0f, 1.0f, 1.0f}, {0.0f,  0.0f, -1.0f}, {0.0f, 0.0f}}, // Bottom-left
        {{ 1.0f,  1.0f, -1.0f}, {1.0f, 1.0f, 1.0f}, {0.0f,  0.0f, -1.0f}, {1.0f, 1.0f}}, // top-right
        {{ 1.0f, -1.0f, -1.0f}, {1.0f, 1.0f, 1.0f}, {0.0f,  0.0f, -1.0f}, {1.0f, 0.0f}}, // bottom-right
        {{ 1.0f,  1.0f, -1.0f}, {1.0f, 1.0f, 1.0f}, {0.0f,  0.0f, -1.0f}, {1.0f, 1.0f}}, // top-right
        {{-1.0f, -1.0f, -1.0f}, {1.0f, 1.0f, 1.0f}, {0.0f,  0.0f, -1.0f}, {0.0f, 0.0f}}, // bottom-left
        {{-1.0f,  1.0f, -1.0f}, {1.0f, 1.0f, 1.0f}, {0.0f,  0.0f, -1.0f}, {0.0f, 1.0f}}, // top-left
        // Front face
        {{-0.5f, -0.5f,  1.0f}, {1.0f, 1.0f, 1.0f}, {0.0f,  0.0f,  1.0f}, {0.0f, 0.0f}}, // bottom-left
        {{ 0.5f, -0.5f,  1.0f}, {0.0f, 0.0f, 0.0f}, {0.0f,  0.0f,  1.0f}, {1.0f, 0.0f}}, // bottom-right
        {{ 0.5f,  0.5f,  1.0f}, {0.0f, 0.0f, 0.0f}, {0.0f,  0.0f,  1.0f}, {1.0f, 1.0f}}, // top-right
        {{ 0.5f,  0.5f,  1.0f}, {1.0f, 0.0f, 0.0f}, {0.0f,  0.0f,  1.0f}, {1.0f, 1.0f}}, // top-right
        {{-0.5f,  0.5f,  1.0f}, {0.0f, 1.0f, 0.0f}, {0.0f,  0.0f,  1.0f}, {0.0f, 1.0f}}, // top-left
        {{-0.5f, -0.5f,  1.0f}, {0.0f, 0.0f, 1.0f}, {0.0f,  0.0f,  1.0f}, {0.0f, 0.0f}}, // bottom-left
        // Left face
        {{-0.5f,  0.5f,  1.0f}, {1.0f, 0.0f, 0.0f}, {1.0f,  0.0f,  0.0f}, {1.0f, 0.0f}}, // top-right
        {{-1.0f,  1.0f, -1.0f}, {1.0f, 0.0f, 0.0f}, {1.0f,  0.0f,  0.0f}, {1.0f, 1.0f}}, // top-left
        {{-1.0f, -1.0f, -1.0f}, {1.0f, 0.0f, 0.0f}, {1.0f,  0.0f,  0.0f}, {0.0f, 1.0f}}, // bottom-left
        {{-1.0f, -1.0f, -1.0f}, {1.0f, 0.0f, 0.0f}, {1.0f,  0.0f,  0.0f}, {0.0f, 1.0f}}, // bottom-left
        {{-0.5f, -0.5f,  1.0f}, {1.0f, 0.0f, 0.0f}, {1.0f,  0.0f,  0.0f}, {0.0f, 0.0f}}, // bottom-right
        {{-0.5f,  0.5f,  1.0f}, {1.0f, 0.0f, 0.0f}, {1.0f,  0.0f,  0.0f}, {1.0f, 0.0f}}, // top-right
        // Right face
        {{ 0.5f,  0.5f,  1.0f}, {0.0f, 0.0f, 1.0f}, {1.0f,  0.0f,  0.0f}, {1.0f, 0.0f}}, // top-left
        {{ 1.0f, -1.0f, -1.0f}, {0.0f, 0.0f, 1.0f}, {1.0f,  0.0f,  0.0f}, {0.0f, 1.0f}}, // bottom-right
        {{ 1.0f,  1.0f, -1.0f}, {0.0f, 0.0f, 1.0f}, {1.0f,  0.0f,  0.0f}, {1.0f, 1.0f}}, // top-right
        {{ 1.0f, -1.0f, -1.0f}, {0.0f, 0.0f, 1.0f}, {1.0f,  0.0f,  0.0f}, {0.0f, 1.0f}}, // bottom-right
        {{ 0.5f,  0.5f,  1.0f}, {0.0f, 0.0f, 1.0f}, {1.0f,  0.0f,  0.0f}, {1.0f, 0.0f}}, // top-left
        {{ 0.5f, -0.5f,  1.0f}, {0.0f, 0.0f, 1.0f}, {1.0f,  0.0f,  0.0f}, {0.0f, 0.0f}}, // bottom-left
        // Bottom face
        {{-1.0f, -1.0f, -1.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, -1.0f,  0.0f}, {0.0f, 1.0f}}, // top-right
        {{ 1.0f, -1.0f, -1.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, -1.0f,  0.0f}, {1.0f, 1.0f}}, // top-left
        {{ 0.5f, -0.5f,  1.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, -1.0f,  0.0f}, {1.0f, 0.0f}}, // bottom-left
        {{ 0.5f, -0.5f,  1.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, -1.0f,  0.0f}, {1.0f, 0.0f}}, // bottom-left
        {{-0.5f, -0.5f,  1.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, -1.0f,  0.0f}, {0.0f, 0.0f}}, // bottom-right
        {{-1.0f, -1.0f, -1.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, -1.0f,  0.0f}, {0.0f, 1.0f}}, // top-right
        // Top face
        {{-1.0f,  1.0f, -1.0f}, {1.0f, 0.0f, 1.0f}, {0.0f,  1.0f,  0.0f}, {0.0f, 1.0f}}, // top-left
        {{ 0.5f,  0.5f,  1.0f}, {1.0f, 0.0f, 1.0f}, {0.0f,  1.0f,  0.0f}, {1.0f, 0.0f}}, // bottom-right
        {{ 1.0f,  1.0f, -1.0f}, {1.0f, 0.0f, 1.0f}, {0.0f,  1.0f,  0.0f}, {1.0f, 1.0f}}, // top-right
        {{ 0.5f,  0.5f,  1.0f}, {1.0f, 0.0f, 1.0f}, {0.0f,  1.0f,  0.0f}, {1.0f, 0.0f}}, // bottom-right
        {{-1.0f,  1.0f, -1.0f}, {1.0f, 0.0f, 1.0f}, {0.0f,  1.0f,  0.0f}, {0.0f, 1.0f}}, // top-left
        {{-0.5f,  0.5f,  1.0f}, {1.0f, 0.0f, 1.0f}, {0.0f,  1.0f,  0.0f}, {0.0f, 0.0f}}, // bottom-left
    },
    Vector<SimpleMesh::Index> {
         0,  1,  2,  3,  4,  5,
         6,  7,  8,  9, 10, 11,
        12, 13, 14, 15, 16, 17,
        18, 19, 20, 21, 22, 23,
        24, 25, 26, 27, 28, 29,
        30, 31, 32, 33, 34, 35,
    },
};
// clang-format off

NAMESPACE_END(vktdev)
